function f(x: number, y?: number) {
    console.log(y)
    return x + (y || 0);
}
console.log(f(1, 2));
console.log(f(1));